<?php
include '../db_params.php';


$term=trim(strip_tags($_GET['term']));
//imprimo en la página la conversión a JSON del array anterior

$qstring = "SELECT sigla FROM cursos WHERE sigla LIKE '%".$term."%' LIMIT 10";
$result = mysql_query($qstring);//query the database for entries containing the term

$array=array(); 
while ($row = mysql_fetch_row($result)){

$array[]=$row[0];

}


print_r(json_encode($array));


?>
